﻿module StreamReaderTests

open System.IO
open NUnit.Framework
open HybridStreamReader

[<TestFixture>]
type testScanning() = 

    [<Test>]
    member self.testReader1() =
        let str = """line1
line2
123456789012345678901234|line 3 - abc"""
        let bytes = System.Text.Encoding.ASCII.GetBytes (str);
        let memStream = new MemoryStream(bytes)
        let stream = new HybridStream(memStream, System.Text.ASCIIEncoding.ASCII)
        let line1 = stream.ReadLine()
        let line2 = stream.ReadLine()
        let byteSection = stream.ReadBytes(25)
        let line3 = stream.ReadLine()
        Assert.AreEqual("line1", line1)
        Assert.AreEqual("line2", line2)
        Assert.AreEqual("123456789012345678901234|"B, byteSection)
        Assert.AreEqual("line 3 - abc", line3)
        

  





